! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
! See https://llvm.org/LICENSE.txt for license information.
! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
!
! test for constant expression : 1.0q0.

program test
  integer, parameter :: qp = 16, n = 13
  real(kind = qp) :: r(n), e(n)
  character(80) :: s(n)
  integer :: result(n), expect(n), i
  expect = 1
  result = 0
  r(1) = 1.23456789123456789123456789123456789q0
  r(2) = 1.23456789123456789123456789123456789Q99
  r(3) = 1.23456789123456789123456789123456789q999
  r(4) = 1.23456789123456789123456789123456789Q+0
  r(5) = 1.23456789123456789123456789123456789q+99
  r(6) = 1.23456789123456789123456789123456789Q+999
  r(7) = -1.23456789123456789123456789123456789q-0
  r(8) = -1.23456789123456789123456789123456789Q-11
  r(9) = -1.23456789123456789123456789123456789q-111
  r(10) = -1.23456789123456789123456789123456789Q-1111
  r(11) = huge(0.0q0)
  r(12) = -tiny(0.0Q0)
  r(13) = epsilon(0.0q0)

  e(1) = 1.23456789123456789123456789123456789e0_qp
  e(2) = 1.23456789123456789123456789123456789e99_qp
  e(3) = 1.23456789123456789123456789123456789e999_qp
  e(4) = 1.23456789123456789123456789123456789e0_qp
  e(5) = 1.23456789123456789123456789123456789e99_qp
  e(6) = 1.23456789123456789123456789123456789e999_qp
  e(7) = -1.23456789123456789123456789123456789e0_qp
  e(8) = -1.23456789123456789123456789123456789e-11_qp
  e(9) = -1.23456789123456789123456789123456789e-111_qp
  e(10) = -1.23456789123456789123456789123456789e-1111_qp
  e(11) = huge(0.0_qp)
  e(12) = -tiny(0.0_qp)
  e(13) = epsilon(0.0_qp)
  
  if(any(r /= e)) STOP 1
  
  print *, 'PASS'  

end program
